package com.sskj.b70.p.fragment;

import com.lzy.okrx2.adapter.FlowableBody;
import com.sskj.b70.m.bean.DagBean;
import com.sskj.b70.m.bean.HttpData;
import com.sskj.b70.m.bean.PageData;
import com.sskj.b70.m.http.JsonConverter;
import com.sskj.b70.p.base.BasePresenter;
import com.sskj.b70.v.activity.DagListActivity;

import java.util.List;

import io.reactivex.Flowable;

/**
 * 作者 :吕志豪
 * 简书：https://www.jianshu.com/u/6e525b929aac
 * github：https://github.com/lvzhihao100
 * 描述：
 * 创建时间：2018-10-11 17:13
 */
public class DagListFragmentPresenter extends BasePresenter<DagListActivity> {
    public Flowable<List<DagBean>> getList(int page,int type){
        return httpService.getDagList(page, type)
                .converter(new JsonConverter<HttpData<PageData<DagBean>>>() {
                })
                .adapt(new FlowableBody<>())
                .map(httpData -> httpData.getData().getList());
    }
}
